home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
doodle_d.swf
/
scripts
/
DefineSprite_28_en11
/
frame_1
/
DoAction.as
Wrap
Text File
|
2013-04-24
|
1KB
|
67 lines
function onEnterFrame()
{
_rotation = _rotation + spin * 4;
if(_root.shieldMC.hitTest(_X,_Y,true) && _root.shieldLevel >= 2)
{
dx = 0;
dy = 0;
}
timer++;
if(timer < 20)
{
_xscale = _xscale + 4;
_yscale = _yscale + 4;
}
else if(timer < 40)
{
_xscale = _xscale - 4;
_yscale = _yscale - 4;
}
else
{
timer = 0;
_xscale = 100;
_yscale = 100;
}
_X = _X + dx;
_Y = _Y + dy;
if(_Y > 880 || _Y < 0)
{
dy *= -1;
_Y = _Y + dy * 2;
}
if(_X < 0 || _X > 640)
{
dx *= -1;
_X = _X + dx * 2;
}
if(this.hitTest(_root.ship))
{
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X;
exp._y = _Y;
_root.eAmount--;
_root.death();
this.removeMovieClip();
}
if(h <= 0)
{
_root.eAmount--;
_root.points += 300;
_root.eD = _root.eD + 1;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X;
exp._y = _Y;
this.removeMovieClip();
}
}
dx = Math.random() * 3 + 3;
dy = (Math.random() * 2 + 2) * -1;
h = 15;
timer = 0;
spin = Math.floor(Math.random() * 3) - 1;